package com.example.qimo.alarm;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.example.qimo.R;
import com.example.qimo.utils.Music;

public class alarmActivity2 extends AppCompatActivity {
Button button;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_alarm2);
button =  findViewById(R.id.guanbi);
button.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        onPause();
        Toast.makeText(getApplicationContext(), "关闭成功", Toast.LENGTH_LONG).show();

    }
});
    }
    @Override
    protected void onPause() {
        // TODO Auto-generated method stub
        super.onPause();
        Music.stop(this);
    }


    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
        Music.play(this, R.raw.qifengl);

    }
}